//
//  PYMapController.m
//  RNCommunity
//
//  Created by 朱吉峥 on 2020/2/26.
//  Copyright © 2020 朱吉峥. All rights reserved.
//

#import "PYMapController.h"
#import <React/RCTRootView.h>
#import "PYRNBridge.h"
#import "PYRNEvent.h"

@interface PYMapController ()

@property (nonatomic, strong) RCTRootView *rootView;

@end

@implementation PYMapController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"MapView";
    self.rootView = [[RCTRootView alloc] initWithBridge:[PYRNBridge sharedBridge]
                                                     moduleName:@"MapView"
                                              initialProperties:nil];
    [self.view addSubview:self.rootView];
    [self.rootView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.left.right.mas_equalTo(0);
    }];
}

- (void)viewSafeAreaInsetsDidChange
{
    [super viewSafeAreaInsetsDidChange];
    [self.rootView mas_updateConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(-self.view.safeAreaInsets.bottom);
    }];
}


@end
